import java.util.Scanner;

import events.Event;
import events.EventDispatcher;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		EventDispatcher eventDispatcher = new EventDispatcher();
		
		TextDisplay textDisplay = new TextDisplay();
		eventDispatcher.addEventListener( textDisplay );
		
		CharactersCounter charactersCounter = new CharactersCounter();
		eventDispatcher.addEventListener( charactersCounter );
		
		Scanner input = new Scanner(System.in);
		while( input.hasNext() ) {
			String text = input.nextLine();
			eventDispatcher.dispatchEvent(new Event(text) );
		}
	}

}
